<template>
  <view class="orders-list">
    <order-list-item-com v-for="order in orders" :key="order.id" :order="order" :default-index="statusIndex"></order-list-item-com>
  </view>
</template>

<script>
import OrderListItemCom from "./OrderListItemCom"

export default {
  name: "OrdersListCom",
  components: {
    OrderListItemCom
  },
  data: () => ({
  	statusIndex: 0,
  }),
  props: {
    orders: {
      type: Array,
      default: []
    },
	defaultIndex: {
	  type: Number,
	  default: 0
	}
	
  },
  watch: {
  	defaultIndex: {
  	  handler(val) {
  	    this.statusIndex = val
  	  },
  	  immediate: true
  	}
  },
}
</script>
<style lang="scss" scoped>

</style>
